package com.immediatus.graphics.factories;

import android.content.Context;
import android.util.DisplayMetrics;
import com.immediatus.graphics.camera.Camera;

public class CameraFactory{
    public static Camera createPixelPerfectCamera(final Context context_, final float centerX_, final float centerY_){
        final DisplayMetrics displayMetrics = CameraFactory.getDisplayMetrics(context_);
        final float width = displayMetrics.widthPixels;
        final float height = displayMetrics.heightPixels;
        return new Camera(centerX_ - width * 0.5f, centerY_ - height * 0.5f, width, height);
    }

    private static DisplayMetrics getDisplayMetrics(final Context context_){
        return context_.getResources().getDisplayMetrics();
    }
}
